package com.xrui.hbase;

import java.io.IOException;

/**
 * Interface for performing batch operations on a HBase Table.  Buffered operations are stored in
 * local memory and flushed on explicit calls to {@link #flush()} or {@link #close()}.  The buffer
 * of an open writer cannot be relied upon to flush before JVM shutdown.
 */
public interface BufferedWriter extends Putter, Deleter {
    /**
     * Set the size of the local write buffer (in bytes).
     *
     * @param bufferSize size (in bytes) to buffer before automatic flush.
     * @throws IOException in case of an error.
     */
    void setBufferSize(long bufferSize) throws IOException;

    /**
     * Commit any buffered writes.
     *
     * @throws IOException in case of an error.
     */
    void flush() throws IOException;
}
